1 Summery 

   Es200601.dll is the third interface procedre (API) , based on software[hotel 2006.01],
it can write /read card and also get the lock record for the third party .
pls install the HOTEL200601, and set the database according to the user manual, select the card encoder and
set the system site code. 
Es200601.dll is using the same database as hotel200601, and it will save the writing card record in the database. 


2 Example:
  Supply the sample source code of DELPHI and VB ,Es200601_D5.dpr,Es200601_VB.vbp


3 Es200601.dll function list 
const
  SUCCEEDED                    = 0;
  ERR_INVALID_DATE             = -1;
  ERR_WRITE_CARD_FAILED        = -2;
  ERR_INVALID_BUILDING_NO      = -3;
  ERR_INVALID_FLOOR_NO         = -4;
  ERR_INVALID_ROOM_NO          = -5;
  ERR_INVALID_CARD_NO          = -6;
  ERR_DATABASE_NOT_OPENED      = -100;
  ERR_CONNECT_DATABASE_FAILED  = -101;
  ERR_CLOSE_DATABASE_FAILED    = -102;
  ERR_DATABASE_NOT_CREATED     = -103;
  ERR_CANNOT_OPEN_COMM_PORT    = -200;
  ERR_CANNOT_CONNECT_DATA_COLLECTOR = -201;
  ERR_INVALID_DATA             = -202;
  
{
   function :
     get the DLL version no. 
   Result:
     version no. integer value.
}
function GetVersion():integer;stdcall; external'es200601.dll' ;

{
  functionconnect to the database 
      before transferthe DLL file, pls transfer OpenDatabase first, open database successfully, then continue 
     
  parameter
       username:pchar; database user name 
       password:pchar;  database password
       if username and password is emptythen system will be log on the database using default user name and password.
  Return value:
        SUCCEEDED: succeed
        other value is failed
}
function OpenDatabase(Username:pchar;Password:pchar):integer;stdcall;external'es200601.dll' ;

{
  functionclose the database
      pls close the database, then exit the prcedure, or it will be out of way 
  return value:
      SUCCEEDED  : succeed
}
function CloseDatabase:integer;stdcall;external'es200601.dll' ;

{
  fucntionmaster card , can open all the locks of this hotel  system 
  parameter
       pcLimitedTime:pchar :valid time, it is valid between these 2 times. 
          pcLimitedTime = '' unlimited time
          pcLimitedTime = 'YYMMDDHHmm' date format: year, month, date, hour, minite, eg.:'0810221200' 2008year10month22date12hour
         dat must >2005/01/01
  return value:
       SUCCEEDED : writing cards succeed
       CardNo : return card no. 
}
function WriteMasterCard(pcLimitedTime:pchar;Var CardNo: integer):integer;
        stdcall;external'es200601.dll' ;

{
  functionemergency card , can open all the locks of this hotel system, including locked up. (deadbolt is out)
  parameter
      pcLimitedTime:pchar: valid time, it is valid between these 2 times. 
        pcLimitedTime = '' unlimited time 
        pcLimitedTime = 'YYMMDDHHmm' date format:year, month, date, hour, minite, eg.:'0810221200' 2008year10month22date12hour
        date must>2005/01/01

  return value:
      SUCCEEDED : writing cards succeed
       CardNo : return card no. 
}
function WriteEmergencyCard(strLimitedTime:pchar;Var CardNo: integer):integer;
        stdcall;external'es200601.dll' ;

{
  function area card, can open all the lock of designated buliding and up to 9 special locks.
  transfer parameter:
      pcLimitedTime:pchar;valid time, it is valid between these 2 times.
         pcLimitedTime = '' unlimited time
         pcLimitedTime = 'YYMMDDHHmm' , date format, year, month, date, hour, minite, eg.:'0810221200' 2008year10month22date12hour
        valid time must>2005/01/01

      BuildingNo1:integer;BuildingNo2:integer; open door rangefrom BuildingNo1 to BuildingNo2  (range1~99)
      pcSpecialRoomTypeList:pchar; can open some special rooms, up to 9 special types, max is 9 .
          eg,:'379000000'  can open special type: room type 379.
  Result:
       transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_INVALID_DATE     = -1;
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_INVALID_BUILDING_NO   = -3;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteMultiBuildingCard(pcLimitedTime:pchar;BuildingNo1:integer;
  BuildingNo2:integer;pcSpecialRoomTypeList:pchar;Var GetCardNo:integer):integer;
  stdcall;external'es200601.dll' ;

{
function, multi-floor card , can open all the locks of the designated floors and  up to 9 special locks. 
  parameter:
       pcLimitedTime:pchar;valid time, it is valid before this time.
          pcLimitedTime = '' unlimitd time. 
          pcLimitedTime = 'YYMMDDHHmm' date format, year, month, date, hour, minite, eg.:'0810221200' 2008year10month22date12hour
        valid time must>2005/01/01

      BuildingNo:integer open door range:designated buliding no.  (range1~99)
      FloorNo1:integer;FloorNo2:integer; floor no.  (range1~99)
      pcSpecialRoomTypeList:pchar; can open some special rooms, up to 9 special types, max is 9 .
          eg,:'379000000'  can open special type: room type 379.
   Result:
        transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no.  ;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_INVALID_DATE     = -1;
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_INVALID_BUILDING_NO   = -3;
          ERR_INVALID_FLOOR_NO      = -4;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteMultiFloorCard(pcLimitedTime:pchar;BuildingNo:integer;FloorNo1:integer;
  FloorNo2:integer;pcSpecialRoomTypeList:pchar;Var GetCardNo:integer):integer;stdcall;external'es200601.dll' ;

{
function:
      Service ( floor ) card , can open all or certain locks of designated floor, and up to 9 special locks. 
      The beginning and end room no. is the open door range, when the beginning room no. is 2 byte(0000),this is double room no. 
      then 2 byte is 9999, this is the single room no. 
      

  parameter:
       pcLimitedTime:pchar;valid time, it is valid before this time.
          pcLimitedTime = '' unlimitd time. 
          pcLimitedTime = 'YYMMDDHHmm' date format, year, month, date, hour, minite, eg.:'0810221200' 2008year10month22date12hour
        valid time must>2005/01/01

      BuildingNo:integer; designated buliding no. (range1~99)
      FloorNo:integer;  designated floor no. (range1~99)
      RoomNo1:integer;RoomNo2:integer; (range1~99)
            designated room no. range : RoomNo1 = 0 ;RoomNo2 = 0  this is double no. of floor card (can open double room no.)
                          RoomNo1 = 99 ;RoomNo2 = 99 this is single no of floor card, can open single room no. 
      pcSpecialRoomList:pchar; can open some special rooms, up to 9 special types, max is 9 .
          eg,:'379000000'  can open special type: room type 379.
   Result:
       transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no.   ;
      transfer failed, return back:
          ERR_INVALID_DATE     = -1;
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_INVALID_BUILDING_NO   = -3;
          ERR_INVALID_FLOOR_NO      = -4;
          ERR_INVALID_ROOM_NO       = -5;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteServiceCard(pcLimitedTime:pchar;
  BuildingNo:integer;FloorNo:integer;RoomNo1:integer;RoomNo2:integer;
  pcSpecialRoomList:pchar;Var GetCardNo:integer):integer;stdcall;
  external'es200601.dll' ;

{
function :
       employee card can open up to 9 special locks. 

  parameter:
       pcLimitedTime:pchar;valid time, it is valid before this time.
          pcLimitedTime = '' unlimitd time. 
          pcLimitedTime = 'YYMMDDHHmm' date format, year, month, date, hour, minite, eg.:'0810221200' 2008year10month22date12hour
        valid time must>2005/01/01


      pcSpecialRoomList:pchar; can open some special rooms, up to 9 special types, max is 9 .
          eg,:'379000000'  can open special type: room type 379.
   Result:
       transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no.  ;
       transfer failed, return back:
          ERR_INVALID_DATE     = -1;
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteEmployeeCard(pcLimitedTime:pchar;
  pcSpecialRoomList:pchar;Var GetCardNo:integer):integer;stdcall;
  external'es200601.dll' ;
  
{
function :  
       unlocking card , can open one or two designated locks and up to 5 special locks.  make it unlocking or locking. 
  
paremeter:
      pcLimitedTime:pchar;valid time, it is valid before this time.
          pcLimitedTime = '' unlimitd time. 
          pcLimitedTime = 'YYMMDDHHmm' date format, year, month, date, hour, minite, eg.:'0810221200' 2008year10month22date12hour
        valid time must>2005/01/01

      pcRoomNo1:pchar;
          the first room no can open, format :buliding no. floor no, room no. special room no. 
         eg.: "0108100" it means bulinding no. 1, floor no. 8, room no. 10, special room no. 0.
      pcRoomNo2:pchar;
         the second room no can open , format : buliding no, floor, no. room no. special room no. 
         eg.: "0108100" it means bulinding no. 1, floor no. 8, room no. 10, special room no. 0.
         it can be empty.
         
      pcSpecialRoomList:pchar; can open some special rooms, up to 5 special types, max is 5 .
          eg,:'37900'  can open special type: room type 379.
   Result:
       transfer succeed , then return back:
          SUCCEED =0;
          paramter  GetCardNo, return card no.   
       transfer failed, return back:
          ERR_INVALID_DATE     = -1;
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_INVALID_ROOM_NO       = -5;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteUnlockingCard(pcLimitedTime:pchar;pcRoomNo1:pchar; pcRoomNo2:pchar;
  pcSpecialRoomList:pchar;Var GetCardNo:integer):integer;stdcall;external'es200601.dll' ;

{
  function:
       one-off card, can be open only once, to open one or two designated locks and up to 5 special locks. it is used for maintenance man.

  parameter :
      pcLimitedTime:pchar;valid time, it is valid before this time.
          pcLimitedTime = '' unlimitd time. 
          pcLimitedTime = 'YYMMDDHHmm' date format, year, month, date, hour, minite, eg.:'0810221200' 2008year10month22date12hour
        valid time must>2005/01/01

      pcRoomNo1:pchar;
           the first room no can open, format :buliding no. floor no, room no. special room no. 
         eg.: "0108100" it means bulinding no. 1, floor no. 8, room no. 10, special room no. 0.
      pcRoomNo2:pchar;
         the second room no can open , format : buliding no, floor, no. room no. special room no. 
         eg.: "0108100" it means bulinding no. 1, floor no. 8, room no. 10, special room no. 0.
         it can be empty.
      pcSpecialRoomList:pchar; can open some special rooms, up to 95 special types, max is 5 .
          eg,:'37900'  can open special type: room type 379.
   Result:
       transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_INVALID_DATE     = -1;
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_INVALID_ROOM_NO       = -5;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteOneOffCard(pcLimitedTime:pchar;pcRoomNo1:pchar; pcRoomNo2:pchar;
  pcSpecialRoomList:pchar;Var GetCardNo:integer):integer;stdcall;external'es200601.dll' ;

{
  function
       backup card can open one or two locks and up to 5 special locks , when the system have some peoblem ,it can be used as keycard for new guest. 

  parameter :
      pcLimitedTime:pchar;valid time, it is valid before this time.
          pcLimitedTime = '' unlimitd time. 
          pcLimitedTime = 'YYMMDDHHmm' date format, year, month, date, hour, minite, eg.:'0810221200' 2008year10month22date12hour
        valid time must>2005/01/01

      pcRoomNo1:pchar;
           the first room no can open, format :buliding no. floor no, room no. special room no. 
         eg.: "0108100" it means bulinding no. 1, floor no. 8, room no. 10, special room no. 0.
      pcRoomNo2:pchar;
         the second room no can open , format : buliding no, floor, no. room no. special room no. 
         eg.: "0108100" it means bulinding no. 1, floor no. 8, room no. 10, special room no. 0.
         it can be empty.
      pcSpecialRoomList:pchar; can open some special rooms, up to 95 special types, max is 5 .
          eg,:'37900'  can open special type: room type 379.
   Result:
       transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_INVALID_DATE     = -1;
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_INVALID_ROOM_NO       = -5;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteBackupCard(pcLimitedTime:pchar;pcRoomNo1:pchar; pcRoomNo2:pchar;
  pcSpecialRoomList:pchar;Var GetCardNo:integer):integer;stdcall;external'es200601.dll' ;

{
   function:
       format card, clear all the memory in E2PROM ,like when th locks leaving the factory. it is valid for all the locks. 
   Result:
      transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteSystemResetCard(Var GetCardNo:integer):integer;stdcall;
  external'es200601.dll' ;

{
   function :
       write site card , make the new system site for locks. it is valid for all the locks. 
   Result:
       transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteSiteCard(Var GetCardNo:integer):integer;stdcall;
  external'es200601.dll' ;

{
   function:
      forbit card, forbit the current key card opening for locks / access control. 
      it is valid for all the locks except passage locks 
   Result:
       transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteForbidCard(Var GetCardNo:integer):integer;stdcall;
  external'es200601.dll' ;

{
   function:
      record cardmake the lock into communitation state, can set or collect the events. 
      if it is magnetic cardpls use extral data collector. 
      if it is Mifare card, if the card sun-mark is 0, pls use extral data collector. 
      or use total 12 pcs record data card , sun-mark in 1-12, all record in wroten on the sector 0, 
      if it is IC card, pls use a IC 24C64 card. 

   Result:
       transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteRecordCard(Var GetCardNo:integer):integer;stdcall;
  external'es200601.dll' ;

{
   function:
      clear memory cardclear all the memory in E2PROM except site code and room no. 
      eg.;open door record, cover record, black list and white list, it is valid for all the locks. 

Result:
        transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteClearMemoryCard(Var GetCardNo:integer):integer;stdcall;
  external'es200601.dll' ;


{
   function: room no. card for locks
      make a room no.and character for locks and other device,
      
   parameter:
      pcRoomNo:pchar;
     room no.eg.:"1234560" it means: buliding no. 12, floor no. 34, room no. 56, 
                   "1234567" it means: buliding no. 12, floor no. 34, room no. 56,sub-room no. is 7.
                   "0000010" it means special room no. 1. 

   Result:
       transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteRoomLockNoCard(pcRoomNo:pchar; var GetCardNo:integer):integer;stdcall;
  external'es200601.dll' ;

{
   function: room no. card for passage
      make a room no.and character for locks and other device,
   parameter:
      pcRoomNo:pchar;
         room no.eg.:"1234560" it means: buliding no. 12, floor no. 34, room no. 56, 
                   "1234567" it means: buliding no. 12, floor no. 34, room no. 56,sub-room no. is 7.
                   "0000010" it means special room no. 1. 

     PassageType:integer;
        passage type : 1 is floor passage 2 is buliding passage 3 is general passage.
        Floor passage----- 1
        Building passage-- 2
        General passage----3
     pcSpecialRoomList:pchar
         the lock is passage locks, its special room no. 1/2/3/4/5/6/7/8/9, up to 9 special room , no empty ,
         if rest pls use 0, ( pls note: from left to rigth )
         
   Result:
         transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WritePassageLockNoCard(pcRoomNo:pchar;PassageType:integer;pcSpecialRoomList:pchar; var GetCardNo:integer):integer;stdcall;
  external'es200601.dll' ;

{
   function: room no. card for special room. 
       make a room no.and character for locks and other device,
   parameter:
      pcRoomNo:pchar;
         room no.eg.:"1234560" it means: buliding no. 12, floor no. 34, room no. 56, 
                   "1234567" it means: buliding no. 12, floor no. 34, room no. 56,sub-room no. is 7.
                   "0000010" it means special room no. 1. 

     SpecialRoomType:integer
         special room no. , range (1~9)
   Result:
       transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteSpecialRoomLockNoCard(pcRoomNo:pchar;SpecialRoomType:integer; var GetCardNo:integer):integer;stdcall;
  external'es200601.dll' ;

{
   function :
       clock card, make time for locks. "year" i only use byte to replace, eg.:2005, just use"05", 
       it is valid for all the locks. 

   parameter:
      pcTime:pchar; lock time. 
         format'yymmddhhnnss'
         eg.:"081230120000" it means 2008 year, 12 month , 30 day , 12 hour, 00 minute, 00 second. 

   Result:
         transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteClockCard(pcTime:pchar; var GetCardNo:integer):integer;stdcall;
  external'es200601.dll' ;

{
   function:
       Setting card ,  it works as site card +room no. card +clock card,one lock need 1 setting card. 
       
   parameter:
    pcRoomNo:pchar;
        rooom no. eg.:"1234560" it means: buliding no. 12, floor no. 34, room no. 56, 
                   "1234567" it means: buliding no. 12, floor no. 34, room no. 56,sub-room no. is 7.
                   "0000010" it means special room no. 1. 

    RoomType:integer;
        room type : 0: non passage,1: floor passage,2: buliding passage, 3: general passage,  4: special room . 

     pcSpecialRoomList:pchar
       when RoomType = 0 this parameter is invalid. 
       when RoomType = 123the lock is passage locks, its special room no. 1/2/3/4/5/6/7/8/9, up to 9 special room , no empty ,
       when RoomType = 4, this parameter is the special room type '1'~'9'
     pcTime:pchar;
          lock checking time
         format'yymmddhhnnss'
         e.g.:"081230120000" it means:08 year, 12 month, 30 date, 12 hour,00 minute, 00 second. 

   Result:
        transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteSettingCard(pcRoomNo:pchar;RoomType:integer;
  pcSpecialRoomList:pchar;pcTime:pchar;
  var GetCardNo:integer):integer;stdcall;
  external'es200601.dll' ;

{
   function :
       report loss card . to make one card informtion invalid on locks / access control. 
       note: room no of reported card and card mark of reported card. not" to read this room no. of reported card 
       when dealing reportloss card , it need to write black list, reportloss card ia valid for the reported locks. 

parameter:
    LossCardNo:integer;
        reported card no. 
   Result:
         transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_INVALID_CARD_NO       = -6;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteReportLossCard(LossCardNo:integer; var GetCardNo:integer):integer;stdcall;
  external'es200601.dll' ;

{
   function :
       release card, the opposite function of reportloss card 
       
   parameter:
    ReleaseCardNo:integer;
        the released card no. 
   Result:
         transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_INVALID_CARD_NO       = -6;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteReleaseCard(ReleaseCardNo:integer; var GetCardNo:integer):integer;stdcall;
  external'es200601.dll' ;
{
   WriteGuestCard
   function:
      guest cazrd/booking card, it can open one or two rooms and op to 5 special rooms. 
  if not booking card, "beginning time", write the current check in time, if booking card, "beginning time"
  write the booking check in time, if not necessary , it is not suggest to make booking card, as if the lock inside 
  clock is not nicety, it will effect the guest to open the lock, if necessary ,we suggest to put some more time on 
  "beginning time" . "batch no.", when one room have many guest, these key card must have same "batch no." 
  "batch no" for each room , it counts separately. (01-99, if over 99,it will cycle to 01).
  when the lock is dealing the key card, if "batch no "is the same with the lock inside"key card coveringbatch no", 
  the it can open the door, if not the same (no matter more than or less than),it need to compare "beginning time",
  if the key card "beginning time" is less than lock inside "key card covering time", it can't open the room , it will 
  show : "card is covered". if the key card "beginning time " is more than lock inside "key card covering time", then   
  write this time one lock inside"key card covering time", and also write the card batch no on the "key card batch no. "
  it can open the room . 
   parameter:
    GuestName:pchar;
   gyest name, it can be empty 
    pcRoomNo1:pchar;
        the first room no this key card can open 
        e.g.:"1234560" it means : buliding no. 12, floor no. 34, room no :56
        e.g.:"1234567" it means : buliding no. 12, floor no. 34, room no :56, sub-room no: 7
    GuestBatchID1:integer;
        guest batch ID for the first room . 
    pcRoomNo2:pchar;
        the second room no this keyc card can open.
        e.g.:"1234560" it means : buliding no. 12, floor no. 34, room no :56
        e.g.:"1234567" it means : buliding no. 12, floor no. 34, room no :56, sub-room no: 7
        it can be empty , thenit only can open 1 room . 
     GuestBatchID2:integer;
          guest batch ID for the second room . when pcRoomNo2='' , it is invalid. 
    RoomType:integer;
        room type:  0 : non-passage, 1: floor passage, 2: buliding passage, 3: general passage,  4: special passage. 

     pcSpecialRoomList:pchar
       up to 5 special room. e.g.::'13500' it means : it can oepn special room type: 135.
      
    pcBeginTime:pchar;
    pcEndTime:pchar;
         valid timeit is valid between this two times. 
          if  pcEndTime = '' it is unlimited time. 
          date format, year, month, date, hour, minite, eg.:'0810221200' 2008year10month22date12hour
        valid time must>2005/01/01
   Result:
         transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function WriteGuestCard(GuestName:pchar;
  pcRoomNo1:pchar;GuestBatchID1:integer;
  pcRoomNo2:pchar;GuestBatchID2:integer;
  pcSpecialRoomList:pchar;
  pcBeginTime:pchar;
  pcEndTime:pchar;
  var GetCardNo:integer):integer;stdcall;
    external'es200601.dll' ;
{
   ReadCardData
   function :
         read the data in cards, return back teh card type and card no. 
  card type list
         sector card 	01
         format catd	10
         site card	11
         room no. card	12
         clock card	13
         setting card	14
         clear all card	15
         forbit card	16
         reportloss card	17
         release card	18
         record card	19
         emergency card 30
         master card	31
         area card	32
         multi-floor card	33
         floor card	34
         employee card	35
         unlocking card 	36
         one-off card 	37
         backing card 	38
         guest card 	39
         booking card 	40

   parameter:
     GetCardType:integer; return back the card type
     GetCardNo:integer;  return back the card no. 
   Result:
         transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_DATABASE_NOT_OPENED     = -100;
}
function  ReadCardData(var GetCardType:integer;var GetCardNo:integer ):integer;stdcall;
 external'es200601.dll' ;

{
   GetLockRecord_USB
   function:
       get history record from data collector ( USB port )
   parameter:
     Var RecordDataBuffer:pchar  return back the collected history record. pls see the relevant file for data format. 
   Result:
       transfer succeed, then return back:
          SUCCEED(0)
          parameter RecordDataBuffer return back the collected history record. 
       transfer failed, then return back:
          ERR_CANNOT_OPEN_COMM_PORT
          ERR_INVALID_DATA
          ERR_CANNOT_CONNECT_DATA_COLLECTOR
}
function GetLockRecord_USB(Var RecordDataBuffer:pchar):integer;stdcall;
  external'es200601.dll' ;
{
   GetLockRecord_COM
   function:
       get the history record from data collector, pls see the relevant file for data format. 
       
   parameter:
     comport:integer;  series port no. 1~9
     Var RecordDataBuffer:pchar  return back the collected history record. 
   Result:
       transfer succeed, then return back:
          SUCCEED(0)
          parameter RecordDataBuffer  return back the collected history record.
       transfer failed, then return back:
          ERR_CANNOT_OPEN_COMM_PORT
          ERR_INVALID_DATA
          ERR_CANNOT_CONNECT_DATA_COLLECTOR
}
function GetLockRecord_COM(ComPort:integer;Var RecordDataBuffer:pchar):integer;stdcall;
  external'es200601.dll' ;





WriteGuestCard2
   function:
          write key card on 2006.01 version
   parameter:
    GuestName:pchar;
    guest name, it can be empty 
    pcRoomNo:pchar;
       the first room no this key card can open, 
       e.g.:"1234560", it means : buliding no. 12, floor no. 34, room no. 56.
       e.g.:"123456", buliding no. 12, floor no. 34, room no. 56.
 GuestCardType:integer;
        new key card or copy key card0 or 1 

    pcBeginTime:pchar;
    pcEndTime:pchar;
          valid timeit is valid between this two times. 
          if  pcEndTime = '' it is unlimited time. 
          date format, year, month, date, hour, minite, eg.:'0810221200' 2008year10month22date12hour
        valid time must>2005/01/01
   Result:
         transfer succeed , then return back:
          SUCCEED =0;
          parameter GetCardNo, return card no. 
       transfer failed, return back:
          ERR_WRITE_CARD_FAILED     = -2;
          ERR_DATABASE_NOT_OPENED     = -100


function WriteGuestCard2(pcGuestName:pchar;GuestCardType:integer;
    pcRoomNo:pchar;
    pcBeginTime:pchar;
    pcEndTime:pchar;
    var GetCardNo:integer):integer

{
  CheckOut2(pcCardNo:integer) :integer
  pcCardNo: card no6 integer 
}
function CheckOut2(pcCardNo:integer):integer;stdcall;